<?php
ob_start();
include_once "../conexion.php";


$f1 = $_POST["f1"];
$f2 = $_POST["f2"];

// $con = mysqli_connect('localhost','peter','abc123','my_db');
// if (!$con)
//   {
//   die('Could not connect: ' . mysqli_error($con));
//   }

// mysqli_select_db($con,"ajax_demo");
// $sql="SELECT * FROM user WHERE id = '".$q."'";

// $result = mysqli_query($con,$sql);

if ($conn) {
  $array12 = "";
  $temp;
   //DE 00 A 01 HRS
  $sql = "select * from tabla_PRUEBA where Datetime between '" . $f1 . "' AND '" . $f2 . "'";
  $stmt = sqlsrv_query( $conn, $sql );
  if( $stmt == false) {
    echo "saber que putas";
    die( print_r( sqlsrv_errors(), true) );
  }

echo "<table border='1'>
  <tr>
    <th>DateTime</th>
    <th>Dato1</th>
    <th>Dato2</th>
    <th>Dato3</th>    
  </tr>";
  while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_NUMERIC) ) {
    echo "<tr>";
    echo "<td>default</td>";
    echo "<td>" . $row[1] . "</td>";
    echo "<td>" . $row[2] . "</td>";
    echo "<td>" . $row[3] . "</td>";    
    echo "</tr>";    
  }
  echo "</table>";
  sqlsrv_free_stmt( $stmt);}
  ?> 